<template>
	<view style="background-color: #f8f8f8;min-height: 100vh;padding: 40rpx; padding-top: 120rpx;">
		<view class=""
			v-if="gzhPageJumpInfo"
			style="background-color: #fff;padding: 40rpx;border-radius: 20rpx;box-shadow: 0px 10px 15px -3px rgba(0,0,0,0.1);">
			<view class="flex items-center ">
				<view class="logo" :style="{backgroundImage: `url(${gzhPageJumpInfo.gzhLogo})`}">
				</view>
				<view class="">
					<view class="">
						{{ gzhPageJumpInfo.gzhName || "" }}
					</view>
				</view>
			</view>

			<view class="" style="margin-top: 20rpx;">
				<image @longpress="longpressHandler" :src="gzhPageJumpInfo.gzhQrCode" show-menu-by-longpress  mode="widthFix" style="width: 100%;"></image>
			</view>

			<view class="content-article-footer">
				长按识别上方二维码图案
			</view>
			<view class="" style="height: 30rpx;">

			</view>

		</view>
	</view>
</template>

<script>
	import {
		gzhPageJumpInfoApi, wxEventCountApi
	} from '../../api/config'
	export default {
		data() {
			return {
				gzhPageJumpInfo: undefined
			}
		},
		onLoad() {
			this.initConfigData()
			const deviceId = uni.getDeviceInfo().deviceId
			wxEventCountApi({
				userUuid: deviceId,
				type: 2,
			})
		},
		methods: {
			async initConfigData() {
				uni.showLoading({
					title: "加载中"
				})
				const res = await gzhPageJumpInfoApi()
				uni.hideLoading()
				this.gzhPageJumpInfo = res.data
			},
			async longpressHandler(){
				const deviceId = uni.getDeviceInfo().deviceId
				wxEventCountApi({
					userUuid: deviceId,
					type: 3,
				})
			}
		}
	}
</script>

<style lang="scss">
	.logo {
		width: 100rpx;
		height: 100rpx;
		background-repeat: no-repeat;
		background-size: cover;
		background-position: center center;
		border-radius: 14rpx;
		margin-right: 30rpx;
	}

	.content-article-footer {
		width: 100%;
		float: left;
		text-align: center;
		font-size: 14px;
		font-weight: 600;
		height: 20px;
		line-height: 20px;
		color: #2F495E;
	}
</style>